from django.db import models
from rest_framework import serializers


class Tag(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=50, unique=True, verbose_name='标签名称')
    heat = models.IntegerField(default=0, verbose_name='热度')

    class Meta:
        db_table = 'sys_tag'


class TagSerializer(serializers.ModelSerializer):
    class Meta:
        model = Tag
        fields = '__all__'
